package com.wan.api.controller;

import com.wan.util.JwtTokenUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;

/**
 * @author xzx
 * @date 2021/5/19 10:06
 */
public class BaseController {
    @Autowired
    private HttpServletRequest request;


    public Integer getUserId(){
        String token =request.getHeader("token");
        return JwtTokenUtils.getOpenId(token);
    }
}
